package com.example.robertluozizhao.framecollectdemo.fragment;

import android.os.Bundle;
import androidx.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

import com.example.robertluozizhao.framecollectdemo.R;
import com.example.robertluozizhao.framecollectdemo.view.custom.WritePadView;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * @author luo_zi_zhao
 * @version V1.0 当前版本描述信息
 * @FileName com.example.robertluozizhao.framecollectdemo.fragment
 * @date 2019/4/25 17:23
 */

public class FragmetManager_WritePadView01_01 extends BaseFragment {

    @BindView(R.id.back_fragment)
    Button mBackFragment;
    @BindView(R.id.title_tv)
    TextView titleTv;
    @BindView(R.id.btn_reset)
    Button btnReset;
    @BindView(R.id.rp)
    WritePadView rp;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_manager_text01_01, null);
        ButterKnife.bind(this, view);
        initView();
        return view;
    }

    private void initView() {
        titleTv.setText("fragment01-01 ...");
        titleTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mFragmentManagerContract != null) {
                    mFragmentManagerContract.showFragment(new FragmetManager_WritePadView01_02());
                }
            }
        });

        mBackFragment.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mFragmentManagerContract.backLastFragment();
            }
        });

        btnReset.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                rp.reset();
            }
        });

    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
    }

}
